#ifndef NEWFRIENDLIST_H
#define NEWFRIENDLIST_H

#include <QWidget>
#include"newfrienditem.h"
#include<QHash>
#include<QTimer>
#include<QListWidgetItem>
namespace Ui {
class newfriendlist;
}

class newfriendlist : public QWidget
{
    Q_OBJECT

public:
    explicit newfriendlist(QWidget *parent = nullptr);
    ~newfriendlist();
    QHash<QString,newfrienditem*> newfriends; //通过account检索每个新添加的朋友
    int nextnewfrientrow=0;
    QHash<int,QString> newfriendsbyrow;  //通过列表行号和account相映射
    QTimer* timer_renewed=new QTimer(this);   //检查列表中是否有元素发生变化
    bool renewed=false;
    QTimer* timer_addfriend=new QTimer(this);   //检查列表中是否有好友是要添加为朋友的
signals:
    void addfriendresult(bool result,QString account,QString image,QString name);
private slots:
    void on_listWidget_itemDoubleClicked(QListWidgetItem *item);

private:
    Ui::newfriendlist *ui;
};

#endif // NEWFRIENDLIST_H
